const mongoose = require('mongoose')

const schema = mongoose.Schema({
    name: String,
    pic: String,
    banner: String,
    nickname: String,
    categories: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'Category' }],
    scores: {
        difficult: Number,
        skill: Number,
        attack: Number,
        survive: Number,
    },
    skills: [{
        pic: String,
        name: String,
        description: String,
        tips: String,
        coldown: String,
        cost: String
    }],
    items1: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'Item' }],
    items2: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'Item' }],
    usageTips: String,
    battleTips: String,
    teamTips: String,
    partners: [{
        hero: { type: mongoose.SchemaTypes.ObjectId, ref: 'Hero' },
        description: String
    }]
})

module.exports = mongoose.model('Hero', schema, 'heroes')